// Import Vue
import Vue from 'vue'

// Import F7
import Framework7 from 'framework7'

// Import F7 Vue Plugin
import Framework7Vue from 'framework7-vue'

// Import F7 iOS Theme Styles
import Framework7Theme from 'framework7/dist/css/framework7.ios.min.css'

import Framework7ThemeColors from 'framework7/dist/css/framework7.ios.colors.min.css'


// Import App Custom Styles
import indexLess from './css/app.less'
import indexStyle from './css/index.css'
import fontStyle from "./font/iconfont.css"
// Import Routes
import Routes from './routes.js'

// Import App Component
import App from './app'
import store from './store/store'
// Init F7 Vue Plugin


Vue.use(Framework7Vue)

//添加自定义ajax到全局
import ajax from './ajax/ajax.js'
Vue.prototype.$ajax = ajax;
//添加loading组件到全局
import load from './components/loading/loading.js'
Vue.use(load, {
	container: '#app',
});
//添加自定义指令到全局
import directive from './components/directive/directive.js'



if (window.location.protocol === 'file:' || window.location.port === '3000') {
    var cordovaScript = document.createElement('script')
    cordovaScript.setAttribute('type', 'text/javascript')
    cordovaScript.setAttribute('src', 'cordova.js')
    document.body.appendChild(cordovaScript)
}


// Init App
window.app = new Vue({
    el: '#app',
    template: '<app/>',
    // Init Framework7 by passing parameters here
    framework7: {
        root: '#app',
        /* Uncomment to enable Material theme: */
        // material: true,
        routes: Routes,
        modalTitle:"提示",
        modalButtonOk: '确定',
        modalButtonCancel: '取消'
    },
    store,
    // Register App Component
    components: {
        app: App
    }
});


